package com.tobe.spring_demo.lifecycle;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.SmartLifecycle;
import org.springframework.stereotype.Component;

/**
 * @author yangqifan 2015年9月16日
 * 
 */
@Component
public class LFTwo implements SmartLifecycle {
	
	@Autowired
	private LFOne one;
	
	public void setOne(LFOne one) {
		this.one = one;
	}

	public void start() {
		System.out.println("LFTwo run start...");

	}

	public void stop() {
		System.out.println("LFTwo run stop...");

	}

	public boolean isRunning() {
		// TODO Auto-generated method stub
		return false;
	}

	/**
	 * 用于控制创建和释放顺序,小的值表明该对象先创建后释放, Integer.MIN_VALUE
	 */
	public int getPhase() {
		return 1;
	}

	public boolean isAutoStartup() {
		return true;
	}

	public void stop(Runnable callback) {
		// TODO Auto-generated method stub

	}

}

